
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
    var Controller = {
        index: function () {
            // 初始化表格参数配置
            Table.api.init({
                extend: {
                    index_url: 'facrm/flow/log/index/flow_id/'+flow_id+"/types_id/"+types_id,
                    add_url: '',
                    edit_url: '',
                    del_url: '',
                    multi_url: '',
                    table: '',
                }
            });

            var table = $("#table");
            // 初始化表格
            table.bootstrapTable({
                url: $.fn.bootstrapTable.defaults.extend.index_url,
                pk: 'id',
                sortName: 'id',
                columns: [
                    [
                        {field: 'id', title: 'ID'},
                        {field: 'nickname', title: __('审批人'), operate: "LIKE"},
                        {field: 'admin_id', title: __('审批人ID'), operate: "LIKE"},
                        {field: 'remark', title: __('意见'), operate: 'LIKE',
                            formatter: function (v,r) {
                                if (r.is_end==1){
                                    v=v+"(结束)"
                                }
                                return v;
                            }},
                        {
                            field: 'create_time',
                            title: __('审批时间'),
                            formatter: Table.api.formatter.datetime,
                            operate: 'RANGE',
                            addclass: 'datetimerange',
                            sortable: true,
							extend: 'autocomplete="off"'
                        },
                        {
                            field: 'status',
                            title: __('Status'),
                            formatter: Table.api.formatter.status,
                            searchList: {0: __('驳回'), 1: __('通过')}
                        },

                    ]
                ]
            });

            // 为表格绑定事件
            Table.api.bindevent(table);
        },
    };
    return Controller;
});


